import 'package:base_flutter/common/api/api.dart';
import 'package:base_flutter/common/global.dart';
import 'package:base_flutter/common/models/home.dart';
import 'package:base_flutter/common/other/load_state.dart';
import 'package:base_flutter/states/base_change_notifier.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class Home extends StatefulWidget {
  const Home({Key? key}) : super(key: key);

  /// 1. 首页banner
  /// 2. 技师推荐
  /// 3. 服务推荐
  /// 4. 系统消息

  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _HomeSate();
  }
}

class _HomeSate extends State<Home> {

  @override
  initState() {
    super.initState();


  }



  @override
  Widget build(BuildContext context) {
    // TODO: implement build

    TextStyle textStyle = const TextStyle(
        color: Color(0xff333333), fontSize: 10, fontWeight: FontWeight.w500);

    return Consumer<UserLocation>(builder: (_, userLocation, child) {
      debugInfo('build home');
      return Scaffold(
        resizeToAvoidBottomInset: false,
        backgroundColor: const Color(0xfff7f7f7),
        appBar: AppBar(
          backgroundColor: Colors.white,
          elevation: 0,
          centerTitle: true,
          title: GestureDetector(
            onTap: null,
            child: Row(
              children: [
                Icon(Icons.local_airport),
                Text(
                  '${userLocation.location?.city}',
                  style: const TextStyle(color: Color(0xff323232), fontSize: 16),
                ),

              ],
            ),
          ),
        ),
        body:  Center(child:Column(children:const [
          Text('Flutter 定位demo'),
          Text('左上角的会显示定位成功后的地址'),
          Text('需要主动在设置里面打开定位权限'),
          Text('需要主动在设置里面打开定位权限'),
          Text('需要主动在设置里面打开定位权限'),
        ], mainAxisAlignment: MainAxisAlignment.center,),),
      );
    });
  }
}
